﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ERP.ERPSystem.ProductionSystem.Dto;
using ERP.Team.ProductionSystem;
using Volo.Abp.Application.Services;
using ERP.Common.Results;

namespace ERP.ERPSystem.ProductionSystem
{
    /// <summary>
    /// 生产系统-生产退料
    /// </summary>
    public interface IProductionMaterialReturnServices:IApplicationService
    {
        /// <summary>
        /// 添加生产退料
        /// </summary>
        /// <param name="productionMaterialReturnDto"></param>
        /// <returns></returns>
        Task<int> AddPMateriaReturn(ProductionMaterialReturnDto productionMaterialReturnDto);
        /// <summary>
        /// 显示生产退料
        /// </summary>
        /// <returns></returns>
        Task<List<ProductionMaterialReturn>> GetPMateriaReturn();
        
        /// <summary>
        /// 获取生产退料列表（分页和搜索）
        /// </summary>
        /// <param name="page">页码</param>
        /// <param name="limit">每页数量</param>
        /// <param name="returnOrderCode">退料单编号</param>
        /// <param name="returnOrderName">退料单名称</param>
        /// <param name="productionWorkOrder">生产工单</param>
        /// <param name="warehouse">仓库</param>
        /// <returns></returns>
        Task<APIPaging<ProductionMaterialReturn>> GetProductionMaterialReturnList(
            int page = 1, 
            int limit = 10, 
            string returnOrderCode = "", 
            string returnOrderName = "", 
            string productionWorkOrder = "", 
            string warehouse = "");
        
        /// <summary>
        /// 更新生产退料
        /// </summary>
        /// <param name="entity">更新数据</param>
        /// <returns></returns>
        Task<int> UpdatePMateriaReturn(ProductionMaterialReturn entity);
        
        /// <summary>
        /// 删除生产退料
        /// </summary>
        /// <param name="id">记录ID</param>
        /// <returns></returns>
        Task<int> DeletePMateriaReturn(int id);
        
        /// <summary>
        /// 批量删除生产退料
        /// </summary>
        /// <param name="ids">记录ID数组</param>
        /// <returns></returns>
        Task<int> BatchDeletePMateriaReturn(int[] ids);
        
        /// <summary>
        /// 根据ID获取单个生产退料记录
        /// </summary>
        /// <param name="id">记录ID</param>
        /// <returns></returns>
        Task<ProductionMaterialReturn> GetPMateriaReturnById(int id);
    }
}
